using System;
using System.Collections.Generic;
using System.Windows.Forms;
using DevExpress.LookAndFeel;
using System.Threading;
using DevExpress.XtraGrid.Localization;

namespace MainApp
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("vi");
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
            GridLocalizer.Active = new VNGridLocalizer(VNGridLocalizer.CreateDefaultLocalizer());
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.UserSkins.BonusSkins.Register();
            UserLookAndFeel.Default.SetSkinStyle("McSkin");
            //Set System language - VIET NAM
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("vi");
            //License license = new License();
            //license.StartPosition = FormStartPosition.CenterScreen;
            FrmMain formMain = new FrmMain();
            formMain.StartPosition = FormStartPosition.CenterScreen;
            Application.Run(formMain);
        }

        static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            MessageBox.Show(e.Exception.Message, "Application error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}